home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
lang
/
PPCsmalltalk.lha
/
PPCSmallTalk
/
docs
/
manbody
< prev
next >
Wrap
Text File
|
1986-10-19
|
28KB
|
1,350 lines
AAAA LLLLiiiittttttttlllleeee SSSSmmmmaaaallllllllttttaaaallllkkkk UUUUsssseeeerrrr MMMMaaaannnnuuuuaaaallll
Timothy A. Budd
_1. _I_n_t_r_o_d_u_c_t_i_o_n
This manual is intended as an aid in using the Little
Smalltalk system. It is not intended to be used as an
introduction to the Smalltalk language. Little Smalltalk is
largely (with exceptions listed in a later section) a subset
of the Smalltalk-80* language described in [.Smalltalk
blue.]. A complete description of the classes included in
the Little Smalltalk system and the messages they accept is
given in Appendix 1.
_2. _R_u_n_n_i_n_g _t_h_e _s_y_s_t_e_m
The Little Smalltalk system is invoked by typing the
command sssstttt. The system is interactive - that is, the user
types an expression at the keyboard and the system responds
by evaluating the expression and typing the result. For
example, typing the expression 3333 ++++ 4444 results in the value 7777
being displayed on the output. Execution is terminated by
typing control-D. A sample execution session is shown in
Figure 1.
% st
Little Smalltalk
3 + 4
7
^D
%
FFFFiiiigggguuuurrrreeee 1111:::: A Sample Little Smalltalk Session
Instance variables for the command level can be created
by assigning a value to a new variable name. Thereafter
that variable can be used at the command level, although it
is not known within the scope of any method. The variable
_________________________
* Smalltalk-80 is a trademark of the Xerox Corporation.
September 19, 1986
- 2 -
``last'' always contains the value returned by the last
expression typed. Figure 2 shows the creation of a vari-
able. Note that the assignment arrow is formed as a two
character sequence.
newvar <- 2 / 3
newvar
0.666667
2 raisedTo: newvar + (4 / 3)
4
last
4
FFFFiiiigggguuuurrrreeee 2222:::: Creating Variables
The default behavior is for the value of expressions,
with the exception of assignments, to be typed automatically
as they are evaluated. This behavior can be modified either
by using the -d flag (see Appendix 2), or by passing a mes-
sage to the pseudo variable ssssmmmmaaaallllllllttttaaaallllkkkk (see Appendix 1).
Class descriptions must be read in from files, they
cannot be entered interactively. Class descriptions are
entered using a system directive. For example, to include a
class description contained in a file named nnnneeeewwwwccccllllaaaassssssss....sssstttt, the
following system directive should be issued:
)i newclass.st
A list of files containing class descriptions can also be
given as arguments to the st command. The command
%st file1 ... filen
is equivalent to the sequence
%st
Little Smalltalk
)i file1
...
)i filen
A table of system directives is given in Figure 3.
Note that the )e system directive invokes an editor on
a file containing class descriptions, and then automatically
includes the file when the editor is exited. Classes also
respond to the message eeeeddddiiiitttt, which will have the same effect
as the )e directive applied to the file containing the class
description. Thus the typical debug/edit/debug cycle
September 19, 1986
- 3 -
_____________________________________________________________
)e filename
Edit the named file. The Little Smalltalk
system will suspend, leaving the user in an
editor for making changes to the named file.
Upon leaving the editor the named file will
automatically be included, as if the )i
directive had been typed.
)g filename
Search for an entry in the system library
area matching the filename. If found, the
class descriptions in the library entry are
included. This command is useful for
including commonly used classes that are not
part of the standard prelude, such as classes
for statistics applications or graphics.
)i filename
Include the named file. The file must
contain one or more class descriptions. The
class descriptions are parsed, and if
syntactically legal new instances of class
CCCCllllaaaassssssss are added to the Smalltalk system.
)l filename
Load a previously saved environment from the
named file. The current values of all
variables are overridden. The file must have
been created using the )s directive (below).
)r filename
Read the named file. The file must contain
Smalltalk statements, as would be typed at
the keyboard. The effect is just as if the
lines of the file had been typed at the
keyboard. The file cannot contain class
descriptions.
)s filename
Save the current state in the named file.
The values of all variables are saved, and
can later be reloaded using the )l directive
(above).
)!string
Execute the remainder of the line following
the exclamation point as a Unix* command.
Nothing is done with the output of the
command, nor is the returning status of the
command recorded.
_____________________________________________________________
||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||
FFFFiiiigggguuuurrrreeee 3333:::: System Directives
September 19, 1986
- 4 -
involves repeated uses of the )e directive or the eeeeddddiiiitttt mes-
sage until a desired outcome is achieved. The editor
invoked by the )e directive can be changed by setting the
EDITOR variable in the users environment.
_3. _D_i_f_f_e_r_e_n_c_e_s _b_e_t_w_e_e_n _L_i_t_t_l_e _S_m_a_l_l_t_a_l_k _a_n_d _t_h_e _S_m_a_l_l_t_a_l_k-
_8_0 _s_y_s_t_e_m
This section describes the differences between the
language accepted by the Little Smalltalk system and the
language described in [.Smalltalk blue.]. The principal
reasons for these changes are as follows:
size Classes which are largely unnecessary, or which could
be easily simulated by other classes (e.g. Associa-
tion, SortedCollection) have been eliminated in the
interest of keeping the size of the standard library
as smal